package com.zzti.controller;

import com.zzti.pojo.SysResult;
import com.zzti.pojo.Visiter;
import com.zzti.serviceImpl.VisiterServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 小程序调用api
 * </p>
 *
 * @author zh
 * @since 2021/5/25
 */
@RestController
public class AppletsController {

    @Autowired
    private VisiterServiceImpl visiterServiceImpl;

    @RequestMapping("visiter/login/api")
    public SysResult loginApi(String account, String password) {
        Visiter vis = visiterServiceImpl.login(account, password);
        if (vis != null) {
            return SysResult.success(vis);
        }
        return SysResult.fail();
    }

    @RequestMapping("api/touch")
    public String touch() {
        return "ab";
    }
}
